/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ru.miit.elearning.vtutor.check.object;

import ru.miit.elearning.vtutor.data.CheckObject;

/**
 *
 * @author Cyclone
 */
public class CheckObjectTypeHelper {

    private CheckObjectTypeHelper() {
    }

    public static final int
            CHECH_OBJECT_TYPE_PS = 0
            , CHECH_OBJECT_TYPE_PDS = 1
            , CHECH_OBJECT_TYPE_PDSChapter = 2
            , CHECH_OBJECT_TYPE_FILE = 5
            , CHECH_OBJECT_TYPE_DIR = 6;

    public static AbstractCheckObject getCheckableInstance(CheckObject co) {
        switch(co.getType()) {
            case CHECH_OBJECT_TYPE_PS:
             return new CheckObjectPSType(co);

            case CHECH_OBJECT_TYPE_PDS:
             return new CheckObjectPDSType(co);

            case CHECH_OBJECT_TYPE_PDSChapter:
             return new CheckObjectPDSChapterType(co);

            case CHECH_OBJECT_TYPE_FILE:
             return new CheckObjectFileType(co);

            case CHECH_OBJECT_TYPE_DIR:
             return new CheckObjectDirType(co);
        }
        return null;
    }
}
